<script setup lang="ts">
import NewsComment from "@/components/NewsComment.vue";
import {onMounted, onUpdated, ref, watch} from "vue";
import { useRoute } from 'vue-router';
import store from "@/store";
useRoute();
const searchResult = ref([])

onMounted(() => {
  searchResult.value = store.state.searchResult;
  watch(() => store.state.searchResult,
      (newVal) => {
          searchResult.value = newVal
      }
  )
})
</script>

<template>
  <div style="display: flex; justify-content: center">
    <div style="display: flex;flex-direction: column; justify-content: center; align-items: center">
      <NewsComment :posts="searchResult"></NewsComment>
    </div>
  </div>
</template>

<style scoped>

</style>